package dynamic

import "time"

type DynamicInstance struct {
	ID              int64     `gorm:"column:id" json:"id" form:"id"`
	InstanceId      string    `gorm:"column:instanceId" json:"instanceId" form:"instanceId"`
	NgvsaInstanceId string    `gorm:"column:ngvsaInstanceId" json:"ngvsaInstanceId" form:"ngvsaInstanceId"`
	Domain          string    `gorm:"column:domain" json:"domain" form:"domain"`
	CreateTime      time.Time `gorm:"column:createTime" json:"createTime" form:"createTime"`
	TenantId        string    `gorm:"column:tenantId" json:"tenantId" form:"tenantId"`
	VSTenantId      string    `gorm:"column:vsTenantId" json:"vsTenantId"`
	PakId           string    `gorm:"column:pakId" json:"pakId" form:"pakId"`
	Port            string    `gorm:"column:port" json:"port" form:"port"`
	Protocol        string    `gorm:"column:protocol" json:"protocol" form:"protocol"`
	ProxyPort       string    `gorm:"column:proxyPort" json:"proxyPort" form:"proxyPort"`
	Status          string    `gorm:"column:status" json:"status" form:"status"`
	FailMsg         string    `gorm:"column:failMsg" json:"failMsg" form:"failMsg"`
	//IsSystem        string      `gorm:"column:isSystem" json:"isSystem" form:"isSystem"`
	DynamicInfo DynamicInfo `gorm:"foreignKey:InstanceId;references:InstanceId" json:"dynamicInfo"`
}

func (DynamicInstance) TableName() string {
	return "dynamic_instance"
}

type DynamicInfo struct {
	Id           int64  `gorm:"column:id;primaryKey" json:"id"`
	DynamicType  string `gorm:"column:dynamicType" json:"dynamicType"`
	InstanceName string `gorm:"column:instanceName" json:"instanceName"`
	InstanceId   string `gorm:"column:instanceId" json:"instanceId"`
}

func (u *DynamicInfo) TableName() string {
	return "dynamic"
}
